package com.hydra.wiki.web.task.impl;

import com.hydra.wiki.web.task.ServletInitJobInter;
import com.hydra.wiki.web.task.TaskListInter;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class TaskListImpl implements TaskListInter {

    @Autowired
    private Map<String, ServletInitJobInter> tasksMap;

    @Override
    public List<ServletInitJobInter> getTasks() {
        return new ArrayList<>(tasksMap.values());
    }

}
